Method and apparatus for absolute optical encoders with reduced sensitivity to scale or disk mounting errors

ABSTRACT

An absolute optical encoder apparatus for measuring an absolute position comprises an optical disk or scale element ( 100 ) having both incremental and absolute code tracks formed thereon. In the embodiment, a photoemitter light source ( 110, 111 ) illuminates the tracks onto a CCD area array sensor ( 115, 116 ) such that an image is formed from a pixel matrix having of rows and columns. Two detector line rows ( 410, 420 ) of the pixel matrix are each read out from the portion of the matrix comprising the incremental and absolute code tracks respectively. Inaccurate mounting of the disk or scale element can cause fluctuations in the period of the code tracks resulting from the rotation of the disk or movement of the scale element. The mounting inaccuracies are compensated for either by matching the spatial frequency by dynamically changing row of detector line read from the incremental image of the code track or by altering the numerical value of the pattern period used in the Fourier phase algorithm. The absolute position is numerically calculated from the imaged code tracks.

FIELD OF THE INVENTION

The present invention relates generally to absolute optical encodersand, more particularly, to a high resolution encoding method andapparatus having adaptive compensation for reducing sensitivity to scaleor disk mounting errors.

BACKGROUND OF THE INVENTION

Optical encoders are electromechanical devices used typically formeasuring position or monitoring motion and controlling the positionwith high precision. They are widely used in applications whereextremely accurate linear or angular positioning information is requiredsuch as in computer-controlled manufacturing, factory automation, orland surveying equipment. Rotary optical encoders sense angular positionby detecting laser light interrupted by markings making up coded tracksembedded on a disk. The disk rotates in sync with the movement beingmonitored. Rotary encoders are generally classified in either one of twocategories i.e. as Absolute or Incremental encoders. Absolute encodersread a distinct coded track on the disk in order to determine a uniqueposition and thus have the advantage of being able to determine theabsolute position after a power failure without having to return to a“home” or index position. Incremental encoders can detect only relativeposition thus the position count can be “lost” in the event of a powerfailure or by severe jarring resulting in inadvertent disk movement. Theadvantage of being able to obtain the absolute position at any timemakes absolute encoders desirable for many applications.

Advances in computer automated manufacturing technology requireimprovements in positioning precision to save space, cost and time.Naturally, the demand for high-resolution encoders capable of providingeven finer incremental linear or rotary motion is greater still.Attempts at developing high-resolution encoders have been described inthe prior art. Included in these are rotary encoders that are able tomeasure both the absolute and incremental angular positionsimultaneously from separate tracks embedded on a glass disk. The trackscorrespond to an absolute track and an incremental track that are readcooperatively to determine an absolute position. Prior art absoluteencoders that employ a single track containing both absolute andincremental position information are generally known to be less accuratethat those using separate tracks.

An example of a prior art absolute encoder is given in U.S. Pat. No.5,235,181 entitled: “ABSOLUTE POSITION DETECTOR FOR AN APPARATUS FORMEASURING LINEAR ANGULAR VALUES.” It describes a position detector wherethe position is detected by reading separate absolute and incrementaltracks. The absolute track is made up of pseudo-random distribution ofbars spaced to form a continuous sequence of unique binary words, eachindicating a distinct value of the absolute position. The arrangementfor reading the absolute track comprises a photoemitter light sourceplaced above the track and a linear type charge transfer detectors CCDlocated beneath the track, such that the pseudo-random absolute track isread through an image enlarging optical lens positioned in between. Theincremental track is read through a sensing unit which comprises aphotoemitter and a group of four photodetectors arranged 90 degreesapart in order to produce signals in quadrature for interpolating stepsin the track. One drawback of the invention is that it employs an olderquadrature detection technique that is can be relatively susceptible toerrors and limited in resolution. Another disadvantage of thisarrangement is that it uses a large number of components that must beaccurately aligned and assembled, and the use of separate sensors toread the absolute and incremental tracks respectively furthercomplicates alignment issues. Moreover, it requires the use of opticallenses, which adds to the cost and complexity of the manufacturingprocess and precludes its use in some relatively small applications.

Another optical encoder device capable of reading both absolute andincremental tracks is described in scientific article entitled:“High-Resolution Optical Position Encoder with Large MountingTolerances”, by K. Engelhardt and P. Seitz, Applied Optics, 1 May 1997.The described encoder detects the absolute track, containing apseudo-random bit code, and an incremental track made up of equallyspaced lines with a specialized ASIC detector chip. A single lightsource illuminates both tracks to be imaged onto the detector using apositive plastic lens. The specialized detector is made up of multiplesections of which one section comprises a CCD line sensor that hasphotosensitive elements for reading a single line to determine theabsolute code pattern. The other two sections, used to capture the imageof the incremental track, each contain two elements with areas shaped assine square functions. These sine functions have the same frequency asthe image of the incremental pattern. The two elements in each sectionare shifted 180° and the two sections are shifted 90° relative to eachother.

The difference between the photocurrents from the two elements in eachsection will represent a Fourier coefficient for an expansion of theimage of the incremental pattern. The phase shift of 90° between the twosections gives that current from the first section will represent a sinecoefficient, I_(sin), and the current from the second section willrepresent a cosine coefficient, I_(cos). The phase of the Image of theincremental track is then calculated as:${\varphi = {\arctan\left( \frac{I_{\cos}}{I_{\sin}} \right)}},$

The detector is able to optically calculate a Fourier expansion of thelight distribution incremental detection, which enables relatively goodresolution. However, a drawback of this configuration is that it is notvery flexible i.e. the period of the image of the incremental track mustmatch the spatial frequency of the sinusoidal shape almost exactly oraccuracy is lost. This can happen when the disk is jarred causing it tomove inadvertently, or by inaccurate disk mounting. This requires thedisk be mounted with very little eccentricity and that the sensor mustbe mounted precisely relative to the disk and the light source. Afurther disadvantage is that the reference period is fixed by virtue ofbeing embedded in the chip, which cannot change during operation.Moreover, the use of the specialized ASIC detector adds to the overallcost to the encoder and limits production in large quantities.

In view of the foregoing, it is desirable to provide an encoderapparatus and method with high resolution that is relatively lessexpensive and easier to assemble with fewer components, less sensitiveto disk mounting errors, and suitable for applications of smalldimensions.

SUMMARY OF THE INVENTION

Briefly described and in accordance with an embodiment and relatedfeatures of the invention, an apparatus and method in accordance withthe present invention is provided. A high-resolution absolute opticalencoding apparatus is provided for calculating an absolute position. Theencoder comprises an optical disk in rotary encoders or optical scaleelement in linear encoders in which both incremental and absolute codetracks are embedded thereon. In an embodiment of the invention, a rotaryoptical encoder comprises a photoemitter light source such as a laserdiode that illuminates the incremental and absolute code tracks suchthat they are imaged onto a CCD area array sensor.

The image is formed onto a pixel matrix having a plurality of rows andcolumns such that a first detector line is read corresponding to a rowof the pixel matrix in the portion of the image comprising theincremental track. Furthermore, a second detector line is read thatcorresponds to a row in the pixel matrix of the image comprising theabsolute track. In the invention, mounting errors due to inaccuratemounting of the disk or scale element cause fluctuations in thereference period of the code tracks that arise from the movement of thedisk or scale element are compensated for by maintaining a constantspatial frequency by dynamically changing the row of detector lines readfrom the image matrix. In another aspect of the invention, compensationis performed by altering the numerical value of the pattern period usedin the Fourier phase algorithm. At least some of the numericalprocessing is performed with a logic circuit such as a FieldProgrammable Gate Array (FPGA). In the embodiment, at least two lightsource-area array sensor pairs are positioned 180 degrees apart suchthat the code tracks are read at two different locations resulting intwo different angular calculations, whereby the absolute angularposition is based on the mean of the two calculations.

In another aspect of the invention, a Total Station theodolite apparatusfor use in topographic surveying includes the invented rotary opticalencoder for measuring angular position in the vertical plane and thehorizontal plane. The encoder cooperates with a servo-mechanism forautomatically tracking a target in what is known as robotic surveying.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention, together with further objectives and advantages thereof,may best be understood by reference to the following description takenin conjunction with the accompanying drawings in which:

FIG. 1 a depicts a simplified side view illustration of the basiccomponents of a rotary optical encoder operating in accordance with afirst embodiment of the invention;

FIG. 1 b depicts a side view illustration of a rotary optical encoderoperating in accordance with a second embodiment of the invention;

FIG. 2 is an illustration of a partial section of the encoder disk usedin the embodiment of the present invention;

FIG. 3 depicts an exemplary CCD area array sensor 300 used in theembodiment of the invention;

FIG. 4 illustrates an area array sensor image of the incremental andabsolute tracks;

FIG. 5 shows an image of an exemplary sensor line from the absolutecode;

FIG. 6 is a diagrammatic top view of the relative positions of the areaarray sensors with respect to the rotary encoder disk in the embodiment;

FIGS. 7 a and 7 b illustrates graphically the numerical calculationmethod;

FIG. 8 shows an exemplary Total Station land surveying instrumentoperating in accordance with the present invention;

FIG. 9 is a diagrammatic side view of the of Total Station surveyinginstrument; and

FIG. 10 shows a functional block diagram of a servo-driven Total Stationoperating in accordance with the invention.

DETAILED DESCRIPTION OF THE INVENTION

A high-resolution optical encoder described by the present inventionlargely avoids the disadvantages of the prior art. The invented encoderenables improved reliability and lower cost compared to the prior art bywhich a simplified design eliminates use of optical enhancement lensesand implements a single light source to image both absolute andincremental tracks onto and a single two-dimensional CCD area arraysensor. Furthermore, the invention exhibits improved flexibility byexhibiting less sensitivity to disk mounting errors and is equallysuitable for linear or rotary encoder applications.

FIG. 1 a depicts a simplified side view illustration of the basiccomponents of a rotary optical encoder operating in accordance with afirst embodiment of the invention. A disk 100 is mounted on a shaft 105that rotates about the shaft axis in direct relationship with the itembeing monitored. The disks used in rotary optical encoders are typicallycomposed of a glass, plastic, ceramic, or metal that have coded markingsprecisely embedded in a track that encircles the outer portion of thedisk. The markings are detected by an arrangement comprising aphotoemitter light source 110,111 mounted on one side of the disk 100and photo detectors 115,116 mounted on the other side of the disk. Thedisk may be of a construction having an opaque background withtransparent markings so that the light passing through the transparentmarkings is detected. Alternatively, the disk can be transparent withopaque markings, in which case the photo detectors detect theinterruption of light by the passing markings.

The encoder components are typically protected by a rugged enclosure toshield the light path and electronics from dust and other elementspresent in hostile industrial environments. In a preferred embodiment,an opaque disk rotates in a manner that allows light to pass throughtransparent markings, which are detected by the photo detector.

FIG. 1 b depicts a side view of a second embodiment of the rotaryoptical encoder operating in accordance with the invention. Thearrangement here is configured so that the photoemitter light source andphoto detector (110,115 and 111,116) is proximally located to each otherand on the same side of the disk. In fact the laser and the sensor canbe incorporated on the same integrated circuit chip, although this isnot necessary. In the preferred embodiment, the light source 110,111 islocated slightly outside the disk 100 such that the emitted light isreflected by mirror 118,119 through the disk and markings, which aredetected by the photo detector 115,116. It should be noted that theinvention is not limited to this configuration and that otherconfigurations are possible such as locating both the light sourceunderneath the disk rather than slightly outside of it or converselylocating the sensor slightly outside the disk instead of the lightsource, for example.

The photo detectors comprise a single charge-coupled-device (CCD) areaarray sensor using a high-density grid of pixels for receiving the lightfrom the light source such as an LED or laser diode. The CCD used can beof a variety of array sensors types, however, the sensor implemented inthe embodiment is preferably an Interline Transfer (ILT) CCD because oftheir simple construction and relatively low cost. ILT CCD area arraysensors are well known in the art and are commonly used in digitalcameras. They account for a large majority of vision industry productsthus the economy of scale typically makes them much less expensivecompared to other types of array sensors. Although ILT CCD array sensorsdo not provide the best image resolution, they make a good choice andfunction well in detecting coded tracks in optical encoders. By way ofexample, a CCD array sensor that has been shown to work well with theinvention is a sensor from Agilent Technologies of Palo Alto, Calif.,U.S.A., model number ADCS-1121, and having 352×288 pixels. Anothersensor that has been shown to work satisfactorily is from HynixSemiconductor of Ichon, Korea, product number HB-7121B and having402×300 pixels.

Referring now to FIG. 2, an illustration of an exemplary codingtechnique used in the embodiment of the present invention for detectingthe absolute position is shown on a partial section of a disk. Theincremental track pattern is comprised of equally spaced markings inradial distribution encircling just inside the outer circumference ofthe disk, as indicated by reference numeral 210.

The absolute track 220 is made up of markings that consist of a seriesof coded lines that include broad and narrow lines radially distributedunderneath the incremental track. The absolute track comprises 156 broadlines that divide the track into 156 equally sized sections. Each broadline serves as a synchronization line or reference line for eachsection. Contained within each section are two narrow data lines thatcarry information about the section number or absolute position. By wayof example, the position can be determined by reading the distance x tothe right from the synchronization line to the first data line, wherebythis distance represents the first digit of the angular position.Similarly, the distance y of the second data line from thesynchronization line represents the second digit of the angularposition. The spatial distance can be measured by counting the markingsof the incremental track. The distances are captured from the sensorimages in number of pixels between the synchronization and data lines.However, the distance is expressed in the number of positions in theincremental code, where a position can be either a line or a opening inthe incremental code. By way of example, the width of a line marking inthe incremental code is calculated as the distance between twosynchronization lines divided by 36. The distance between thesynchronization and data lines is then scaled with this factor to getthe distance in positions of the incremental code. Those skilled in theart will appreciate that the coding scheme described in the embodimentis exemplary by which the invention is not limited to, and that anysuitable coding pattern can be used that enables the absolute positionto be uniquely and unambiguously detected.

FIG. 3 depicts an exemplary CCD array sensor 300 of the embodiment thatis capable of capturing an image (or individual lines) containing boththe incremental and absolute tracks in single “snapshot.” The imagingarea 310 of the array is a silicon based IC comprising a dense matrix ofphotodiodes or pixel elements that captures the image by converting theincident light from the tracks into an electric charge which is thenprocessed into and electrical signals. It should be noted that othermainstream sensor array technologies are suitable for use with theinvention such as Complementary Metal Oxide Semiconductor or CMOSsensors, which consist of an array of CMOS pixels of photosensitiveelements. The image captured by the array sensor is divided into a topand bottom portion whereby the top portion contains image of theincremental track. Likewise, the bottom portion contains the image of atleast one complete section of the absolute track. The area array sensoris sufficiently sensitive and positioned close enough to the disk to beable to capture the images without the need for optical lenses.

FIG. 4 illustrates a captured image that includes both the incrementaland absolute tracks. The tracks are read by a pair of image detectorlines, one line (410) spans across the top portion of the image thatcomprises an image of the incremental track, and another line (420)spanning across the bottom portion comprising the image of the absolutetrack. The detector line (420) comprising the image of the absolutetrack is preprocessed with a very fast logic circuit such as a FieldProgrammable Gate Array (FPGA). FPGAs are widely used programmabledevices that provide fast processing in hardware combined with theability to be reconfigured for a wide variety of applications. Detectingthe presence of a synchronization line or data line is performed bydetecting the intensity change by which it rises above and drops below apredefined intensity threshold value, which is used to determine wherethe peaks start and where they end. The identification is preformed byusing a sum of the pixel intensities from the edge-to-edge of the imagedmarking and comparing the sums with a discrimination threshold. Once apeak is detected, the discrimination threshold is used to discriminateand determine whether the peak is a synchronization line or a data line.

FIG. 5 shows an image of an exemplary sensor line from the absolutecode. In the example a intensity threshold value of 40 is used to detectthe beginning and the end of the peaks. The pixel values are summed fromthe beginning of the peak to the end, as shown by the shaded area oneach peak. In this case, the summed intensities are [541, 519, 1155,413, 500, 1278, 428], as can be seen in the image. To determine whichpeaks are from data lines and which are from synchronization lines, thesummed intensities are compared to the discrimination threshold value,which in this case is chosen to be 800. Hence, by this criteria peaknumbers 3 and 6 are synchronization lines while peaks 1, 2, 4, 5 and 7are data lines.

The center positions of the lines and the summed intensities are passedfrom the FPGA to a processor to calculate the absolute position. By wayof example, an example of a processor that has shown to work well withthe invention is ARM-processor referred to as AT91M42800A-33AI.

The section numbers are calculated from the distance from thesynchronization line to the first and the second data lines. Once thesection number is determined the exact angular positions ofsynchronization lines and the data lines can be calculated. Using theknown position of the lines, a rough estimate of the angular positioncan be calculated. The rough angle estimate is accurate enough todetermine the position down to one period of the incremental track. Theimage from the incremental track is analyzed using a numerical Fouriermethod in which the FPGA performs the majority of the calculations andthe processor calculates the absolute angle.

FIG. 6 is a diagrammatic top view of the encoder disk showing therelative positions of the area array sensors used in the embodiment. Thearray sensors are shifted 180 degrees apart in a configuration thatenables both tracks to be read at two separate positions resulting intwo distinct angles. The two angles help to make the absolute opticalencoder insensitive to mounting errors since the resulting angularposition measured by the encoder is given by mean value of the twoangles. Therefore, first order errors effectively get cancelled out formotion along the path, because the mean is inherently invariant to diskmovements. Several kinds of mounting errors will give rise to errors inthe read angle. To increase the accuracy and keep the costs low bylowering the precision required for mounting the disk, it is desirableto compensate for as many mounting errors as possible. For example, ifthe area-sensor is mounted with a rotational error in the plane of theencoder disk the angle measured will change if the line used on thesensor is changed. Fortunately, if the tilt angle is known it is veryeasy to compensate for this error. This can be done by reading severallines at a time, while keeping the angular position unchanged, anddetermine the angular position for them all. If the angular position isthe same for all the lines the sensor is mounted correctly, if not thesensor is mounted with an error that can be calculated from the varyingangular positions and used to compensate the angle as the used line ischanged.

The design with two source-detector pairs placed 180° apart has thebeneficial characteristic in that all errors due to translation of thedisk are effectively canceled. However, mounting errors could cause thetwo source-detector pairs to be placed at not exactly 180° apart. Someof these errors can be compensated for if the actual angular distancebetween the two source-detector pairs is known. This distance can becalculated by subtracting the angle read on the two sensors. Althoughtwo source-detector pairs are described in the preferred embodiments, itshould be noted that the invention is not limited to this configurationand that it is possible to implement a single source-detector pair oreven three or more source-detector pairs to work with the invention.

The outer track containing the high-resolution incremental code isimaged and the data is sent to the FPGA for preprocessing to calculatethe resolution.

FIG. 7 a illustrates graphically the numerical Fourier method carriedout by the FPGA. The output signal read from the disk by the arraysensor is digitized and depicted by the top signal shown. The product ofthe digitized output signal and a digitized cosine signal cos(V) (middlesignal) is depicted by the bottom signal. Each result is summed incalculations performed by the FPGA. Likewise FIG. 7 b illustrates theproduct of the signal with a sin(V) signal. Since any sinusoidalfunction can be written as,A sin(x+φ)=B sin(x)+C cos(x)both the amplitude information A and the phase information φ from theleft side of the equation can be represented by the two coefficients Band C on the right side of the equation. The relationship between thetwo ways to write the sine function is:${\varphi = {{\arctan\left( \frac{C}{B} \right)}\quad{and}}},{A = \sqrt{B^{2} + C^{2}}}$

This implies that if we can approximate our signal with the form Bsin(x)+C cos(x), the phase can be calculated as the arc tan(C/B). Thisapproximation is found by using Fourier mathematics. The Fourierexpansion of a periodic function ƒ(x) with period T is written as:${f(x)} = {\frac{a_{0}}{2} + {\sum\limits_{n = 1}^{\infty}\left( {{a_{n}\cos\quad\frac{n\quad 2\pi\quad x}{T}} + {b_{n}\sin\quad\frac{n\quad 2\pi\quad x}{T}}} \right)}}$

where a_(n) and b_(n) is calculated as:$a_{n} = {\frac{2}{T}{\int_{a}^{a + T}{{{f(x)} \cdot \cos}\quad\frac{n\quad 2\pi\quad x}{T}{\mathbb{d}x}}}}$$b_{n} = {\frac{2}{T}{\int_{a}^{a + T}{{{f(x)} \cdot \sin}\quad\frac{n\quad 2\pi\quad x}{T}{\mathbb{d}x}}}}$

where the coefficient a₀ is the mean value of ƒ(x). The two first ordercoefficients, a₁ and b₁, gives a sine approximation of ƒ(x) and thehigher order coefficients gives a more exact form of ƒ(x). If we couldcalculate the two first order coefficients of our signal we couldcalculate its phase as arc tan(a₁/b₁). According to the expressions fora_(n) and b_(n), they are calculated using only one period of thesignal. However the signal is not exactly periodic and we want to useall the information in the signal. Therefore it is possible to modifythe expressions to:$a_{n} = {\frac{2}{Tm}{\int_{a}^{a + {mT}}{{{f(x)} \cdot \cos}\quad\frac{n\quad 2\pi\quad x}{T}{\mathbb{d}x}}}}$$b_{n} = {\frac{2}{Tm}{\int_{a}^{a + {mT}}{{{f(x)} \cdot \sin}\quad\frac{n\quad 2\pi\quad x}{T}{\mathbb{d}x}}}}$

where m is the number of periods used, i.e. (number of pixels)/(periodof pattern). This means that we integrate over several periods of thesignal. In our case ƒ(x) is not continuous but discrete, ƒ_(j) is thevalue of pixel number j, thus the integrals are therefore replaced withsums over the pixels:$a_{n} = {\frac{2}{Tm}{\sum\limits_{j = 1}^{N}{{f_{j} \cdot \cos}\quad\frac{n\quad 2\pi\quad x_{j}}{T}\Delta\quad x_{j}}}}$$b_{n} = {\frac{2}{Tm}{\sum\limits_{j = 1}^{N}{{f_{j} \cdot \sin}\quad\frac{n\quad 2\pi\quad x_{j}}{T}\Delta\quad x_{j}}}}$

where N is the total number of pixels and Δx_(j) is the width of eachpixel. We are only interested in the first order coefficients i.e. n=1,and furthermore it is only the ratio between them that is of interest,everything else that is common to both expressions is canceled.Moreover, x_(j) is simply the pixel number which can be replaced with jresulting in:$a_{1} = {\sum\limits_{j = 1}^{N}{{f_{j} \cdot \cos}\quad\frac{\quad{2\pi\quad j}}{T}}}$$b_{1} = {\sum\limits_{j = 1}^{N}{{f_{j} \cdot \sin}\frac{2\pi\quad j}{T}}}$

where finally the phase is calculated as arc tan(a₁/b₁).

The absolute angle ω_(a) is read from the code of the inner track in themanner previously outlined. The processor then calculates the finalangular position ω_(f),$\omega_{f} = {{{{round}\left( \frac{{\omega_{a} \cdot N_{sect}} - {\arctan\left( {C/S} \right)}}{2\pi} \right)} \cdot \frac{2\pi}{N_{sect}}} + \frac{\arctan\left( {C/S} \right)}{N_{sect}}}$

where N_(sect) is the total number of periods in the incremental track.In the present invention the incremental track contains 2808 periods.The round operation indicates that the number should be rounded to theclosest integer.

The accuracy of calculations is down to approximately 1 microradian forthe final position. Improving the accuracy depends largely on the amountof available processor power that can perform the calculations within areasonable time.

The method of the present invention is rather flexible in comparisonwith the prior art, with respect to the accuracy needed to mount thedisk in the encoder. By way of example, if the disk is not preciselymounted the tracks will shift or wobble slightly as the disk rotateswhich can result in misalignments in pitch, roll, yaw and other types oferrors. The method enables the encoder to detect and compensate forsmall mounting errors thereby allowing for larger mounting errors thanin the prior art. The compensation is possible because the Fourieranalysis is performed numerically thus allowing the encoder todynamically change the period of the references in contrast to thespatial frequency being fixed in the detector chip which cannot bechanged during operation.

The encoder can adapt to and compensate for a fluctuating pattern perioddue to inaccurate mounting of the disk. Compensation can be applied byusing either one of two techniques. The first technique is todynamically change the detector line of the incremental track image. Ifthe pattern period changes due to a spatial movement of the disk, theused line is shifted so that it always contains an image with the samepattern period. The second option is to alter the numerical value of thepattern period used in the Fourier phase algorithm. In the preferredembodiment, the first technique is applied to dynamically change thedetector line since altering the spatial frequency numerically canrequire a large amount of processing power. However, if the alternativewith changing the lines is chosen, the sine and cosine values used inthe sums in the Fourier phase algorithm can be generated in advance andstored in a table in memory. If the period in the calculations ischanged, new sine and cosine values must be generated each time theperiod changes. Furthermore, some pattern periods tend to give betteraccuracy than others, for example, when exactly a whole number ofperiods is contained within the width of the detector. By changing theline it is possible to select a favorable pattern period to use in thecalculations that may somewhat reduce the processing requirements.

The present invention contemplates a high-resolution optical encoderthat is less sensitive to disk mounting errors and requiring no opticsmakes it especially suitable for applications where a small encoderprofile and simple construction would be advantageous. By way ofexample, theodolite devices used for carrying out topographic mappingsuch as land surveying employ optical encoders for the precisemeasurement of vertical and horizontal angular positions. Shown in FIG.8, the devices are also referred to as Total Stations 700 to thoseskilled the art and are capable of electronic distance measurement (EDM)for precisely measuring distances, in addition to angular displacement.Precise distance measurements are performed with a laser that transmitsan infra-red frequency modulated signal 710 on a light wave to aretro-directive prism pole reflector 720 to return the signal, where thephase difference between the transmitted and received signal is used tocalculate the distance. The Total Station instrument 700 is configuredso it can pivot up and down and swivel horizontally in order to makeprecise angular measurements in the vertical and horizontal planes.

FIG. 9 is a diagrammatic side view of the main body of the Total Stationinstrument 700 illustrating the locations of the optical encoder disks800,810 for measuring angular displacement in the vertical plane whenthe main body pivots up and down and in the horizontal plane fromswiveling side-to-side. Advanced instruments such as the 5600 series ofTotal Stations manufactured by Trimble AB of Sweden offer features suchas a servo-driven capability and automatic search that allows theinstrument to automatically follow a target as it is moved. Otheradvanced features include radio telemetry for communication with theprism reflector and active targets to eliminate the risk of falsereflections that may be mistakenly accepted by the instrument. Theencoders enable active and precise control of the servo mechanisms inwhat is known in the art as Auto Tracking Surveying or RoboticSurveying.

FIG. 10 shows a functional block diagram of how a servo-driven TotalStation, capable of auto tracking a target, is implemented with theoptical encoder of the present invention. Since the instrument iscapable of operating in several different modes, input from the modesare individually selected for use in the servo-loop by a multiplexer910. The output of the multiplexer 910 is fed into servo loop whichcomprises a controller 912, a Drive, 914, and an Angular sensor 916. Thecontroller makes the suitable analyses and determines how the drive isto be moved. The angular sensor or encoder of the present inventiondetects the position of the axis and feeds it back to be compared withthe input angle.

The function of the servo loop is to position the axis driven by theDrive 914 to a certain position given on the input. The input angle canbe different when the instrument is used in different modes. Forinstance, when used normally the control knobs 902 are used primarily tooperate the instrument. When the user wants to change the vertical orthe horizontal angle, he turns the control knob for the vertical or thehorizontal axis respectively. This means that the input angle to theservo system is changed in relation to the movement of the knobs. Inanother mode, the instrument can be used for outputting certainpositions e.g. the corners of a building that is to be built. In thiscase the position is typed on the control unit and the input anglecorresponding to that position is calculated, this is referred to as thereference angle 904. In yet another mode, the instrument can be used toautomatically track a target. In this case the tracker unit 906 detectsthe movements of the target and changes the input angle to the servoloop so that the instrument tracks the movements of the target.

When initially starting up the encoder, both of the tracks are read tocalculate the exact absolute angle. When the absolute angle is known itis not necessary to calculate the absolute angle from the absolutetrack. Instead, the encoder can be used in an incremental mode whereonly the incremental track is read. When a new incremental angle is readfrom the incremental track, the new absolute angle can be calculatedfrom the last absolute angle and knowledge about the rotation speed ofthe axis.

If the two last absolute angular positions where ω_(k-2) and ω_(k-1) andthe new incremental angle is ω_(inc) then the new absolute angularposition, ω_(k), can be calculated as,$\omega_{k} = {{{{round}\left( \frac{{\left( {\omega_{k - 1} + {\Delta\omega}_{k - 1}} \right) \cdot N_{sect}} - \omega_{inc}}{2\pi} \right)} \cdot \frac{2\pi}{N_{sect}}} + \frac{\omega_{inc}}{N_{sect}}}$where  Δω_(k − 1) = ω_(k − 1) − ω_(k − 2)

This is similar to the way the absolute and incremental angle from thetwo tracks is forged together. However, the absolute angle does not comefrom reading the absolute track but from assuming that the absoluteangle is the last known absolute angle plus the last known angularchange. It has been found that this assumption is usually correct enoughas long as the angular acceleration is not too large. Laboratoryanalyses have shown that the instrument must be struck very hard toachieve this kind of acceleration. Notwithstanding, subjecting theinstrument to forces that are likely to make it lose track of theabsolute angle are likely to cause severe damage to the instrument. Aprimary advantage with this is that the calculation of the absoluteangle from the absolute track does not have to be a priority task in thecontroller. Therefore, the absolute angles do not need to be calculatedat the same high rate as with the incremental angles. In the embodiment,when an absolute angle is calculated from the absolute track, it iscompared with the angle calculated in the incremental mode as describedabove to check that the encoder has not lost track of the absoluteangle.

The foregoing description of the preferred embodiments of the inventionhas been presented for purposes of illustration and description. It isnot intended to be exhaustive or to limit the invention to the preciseforms disclosed, since many modifications or variations thereof arepossible in light of the above teaching. For example, inventive conceptis suitable for use in both rotary and linear encoders using a scaleelement in place of a disk. Furthermore, the invention applicable tosensor configurations other than those described in the preferredembodiments, for example, configurations of three sensors, four sensorspositioned 90 degrees apart, or more than four sensors etc.

Still other modifications will occur to those of ordinary skill in theart. All such modifications and variations are within the scope of theinvention. The embodiments chosen were described in order best toexplain the principles of the invention and its practical application,thereby enabling those skilled in the art to utilize the invention invarious embodiments and with various modifications as suitable for theparticular use contemplated. It is therefore the intention that thefollowing claims not be given a restrictive interpretation but should beviewed to encompass variations and modifications that are derived fromthe inventive subject matter disclosed.

1. An absolute position rotary encoding apparatus comprising: a diskhaving a first code track and a second code track formed thereon saiddisk; a light source for illuminating said code tracks; an area arraysensor configured to receive the light illuminating said code tracks forimaging a portion of said first and second code tracks simultaneously,said area array sensor capable of imaging onto a pixel matrix having aplurality of rows; means for reading a first detector line correspondingto a row in the pixel matrix comprising the first code track; means forreading a second detector line corresponding to a row in the pixelmatrix comprising the second code track; means for compensating forfluctuations in the code track resulting from the disk beinginaccurately mounted by selecting a suitable line imaged by the areaarray sensor such that the period length of the imaged pattern of thecode tracks matches the period length used in the position calculation;and processing means for numerically calculating an absolute positionbased on the imaged code tracks from the disk.
 2. An encoding apparatusaccording to claim 1, wherein the scale element is an optical disksuitable for use in a rotary encoder and the first code track representsthe incremental track and the second code track represents the absolutetrack.
 3. An encoding apparatus according to claim 1, wherein said lightsource is a photoemitter such as an LED, laser diode, or incandescentlight source.
 4. An encoding apparatus according to claim 1, wherein thearea array sensor is constructed of either CCD or CMOS photodiodetechnology.
 5. An encoding apparatus according to claim 1, wherein saidlight source and said area array sensor are proximally located on afirst side of the scale element and a mirror located on a second side,whereby the emitted light is reflected by the mirror through the scaleelement to illuminate the code tracks for reception by the sensor.
 6. Anencoding apparatus according to claim 1, wherein the processing meansfurther includes a Field Programmable Gate Array (FPGA) logic circuitfor numerically calculating the phase intensity distribution, thespatial frequency and the phase angle of the image of the code tracks.7. An encoding apparatus according to claim 1, wherein at least two areaarray sensors are positioned 180 degrees apart such that the incrementaland absolute code tracks are read at two different locations resultingin two different angular positions, and wherein the absolute position isbased on the mean of the angular positions.
 8. An encoding apparatusaccording to claim 2, wherein the incremental track is comprised of aplurality of equally spaced and radially distributed markings near theouter edge of the disk, and wherein the absolute track is comprised ofmarkings that form a series of coded lines that include broad and narrowlines radially distributed inside the incremental track such that thebroad lines divide the track into equally sized sections and within eachsection are two narrow data lines that carry information about absoluteposition.
 9. An encoding apparatus according to claim 1, wherein themeans for compensating include means for dynamically changing thedetector line of the incremental track image, when the pattern periodchanges due to inaccurate mounting of the scale element which causesundesirable spatial movement of the code track, the detector line isshifted so that it always includes an image with the same patternperiod.
 10. An encoding apparatus according to claim 1, wherein themeans for compensating include means for altering the numerical value ofthe pattern period used in the Fourier phase algorithm to match thespatial frequency of fluctuating tracks.
 11. An encoding apparatusaccording to claim 1, wherein four area array sensors are positioned 90degrees apart such that the incremental and absolute code tracks areread at four different locations.
 12. A Total Station theodoliteapparatus used for topographic surveying and mapping includes an opticalencoder for measuring angular position in the vertical plane and thehorizontal plane and cooperates with a servo-mechanism for automaticallytracking a target, wherein said encoder comprising: an optical diskhaving an incremental code track and an absolute code track formedthereon; a photoemitter light source for illuminating the incrementaland absolute code tracks; an area array sensor configured to receive thelight illuminating said code tracks for imaging a portion of saidincremental and absolute code tracks from the disk simultaneously, saidarea array sensor being capable imaging onto a pixel matrix having aplurality of rows; means for reading a first detector line correspondingto a row in the pixel matrix comprising the incremental track; means forreading a second detector line corresponding to a row in the pixelmatrix comprising the absolute code track; means for compensating for ashifting code track resulting from inaccurate mounting of the disk byselecting a suitable line imaged by the area array sensor such that theperiod length of the imaged pattern of the code tracks matches theperiod length used in the position calculation; processing means forcalculating an absolute position based on the imaged code tracks fromthe disk; and means for calculating the topographic data and trackinginformation about the target.
 13. A Total Station apparatus according toclaim 12, wherein the optical disk opaque with transparent code trackmarkings or a transparent disk with opaque code track markings.
 14. ATotal Station apparatus according to claim 12, wherein the photoemitteris an LED, laser diode, or incandescent light source and the area arraysensor is an Interline Transfer (ILT) CCD area array sensor.
 15. A TotalStation apparatus according to claim 12, wherein the processing meansfurther includes a Field Programmable Gate Array (FPGA) logic circuitfor numerically calculating the phase intensity distribution, thespatial frequency and the phase angle of the image of the code tracks.16. A Total Station apparatus according to claim 12, wherein at leasttwo area array sensors are positioned 180 degrees apart such that theincremental and absolute code tracks are read at two different locationsresulting in two different angular positions, and wherein the absoluteposition is based on the mean of the angular positions.
 17. A TotalStation apparatus according to claim 12, wherein the incremental trackis comprised of a plurality of equally spaced and radially distributedmarkings near the outer edge of the disk, and wherein the absolute trackis comprised of markings that form a series of coded lines that includebroad and narrow lines radially distributed inside the incremental tracksuch that the broad lines divide the track into equally sized sectionsand within each section are two narrow data lines that carry informationabout absolute position.
 18. A Total Station apparatus according toclaim 12, wherein the calculating means is performed by a processor anda controller for operating the automatic tracking servo-mechanism.
 19. ATotal Station apparatus according to claim 12, wherein the means forcompensating include means for dynamically changing the detector line ofthe incremental track image, when the pattern period changes due tospatial movement of the disk, the detector line is shifted so that italways includes an image with the same pattern period.
 20. A TotalStation apparatus according to claim 12, wherein the means forcompensating include means for altering the numerical value of thepattern period used in the Fourier phase algorithm to match the spatialfrequency of fluctuating tracks.
 21. A method of calculating an absoluteposition with an optical rotary encoder device comprising the steps of:illuminating with a light source an incremental code track and anabsolute code track formed on a disk; imaging a segment of theincremental and absolute code tracks onto a CCD or CMOS area arraysensor wherein the segment is imaged onto a pixel matrix having aplurality of rows; reading a first detector line corresponding to a rowin the matrix comprising the incremental code track; reading a seconddetector line corresponding to a row in the matrix comprising theabsolute code track; compensating for fluctuations in the code tracksresulting from inaccurate mounting of the disk by selecting a suitableline imaged by the area array sensor such that the period length of theimaged pattern of the code tracks matches the period length used in theposition calculation; and calculating numerically the absolute positionbased on the light distribution of the images of the incremental andabsolute code tracks.
 22. The method according to claim 21, wherein atleast two area array sensors are positioned 180 degrees apart such thatthe incremental and absolute code tracks are read at two differentlocations resulting in two different angular positions, and wherein theabsolute position is based on the mean of the angular positions.
 23. Themethod according to claim 21, wherein said light source and said areaarray sensor are proximally located on a one side of the scale elementand a mirror located on the other side, whereby the emitted light isreflected by the mirror through the scale element to illuminate the codetracks for reception by the sensor.
 24. The method according to claim21, wherein the compensating step dynamically changes the detector lineof the incremental track image when the pattern period changes due tospatial movement of the disk, the detector line is shifted so that italways includes an image with the same pattern period.
 25. The methodaccording to claim 21, wherein the compensating step includes alteringthe numerical value of the pattern period used in the Fourier phasealgorithm to match the spatial frequency of fluctuating tracks.
 26. Themethod according to claim 21, wherein at least a Field Programmable GateArray (FPGA) performs at least a portion of the numerical calculations.27. The method according to claim 21, wherein four area array sensorsare positioned 90 degrees apart such that the incremental and absolutecode tracks are read at four different locations.